<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<header class="header">
    <span style="float: right;margin-left: 10px;">
    <a href="?lang=en"><spring:message code="lang_en"/></a>
    |
    <a href="?lang=ua"><spring:message code="lang_ua"/></a>
</span>
    <c:if test="${user==null}">
        <form class="login-form" action="/j_spring_security_check" method="post">
            <label class="login-field">
                <span class="login-label"><spring:message code="label.login_email"/></span>
                <input id="username" class="login-input" name="j_username">
            </label>
            <label class="login-field">
                <span class="login-label"><spring:message code="label.user_password"/></span>
                <input id="password" class="login-input" name="j_password" type="password">
            </label>
            <button class="login-submit" type="submit"><spring:message code="label.enter_info"/></button>
            <a class="login-registration" href="/registration"><spring:message code="label.question_reg"/></a>
        </form>
    </c:if>
    <c:if test="${user!=null}">
        <a class="user-logout" href="/j_spring_security_logout"><spring:message code="label.log_out"/></a>
        <h1 class="user-name">${user.username}</h1>
    </c:if>
    <div class="heading">
        <h1 class="head-title">
            <a href="/librry"><spring:message code="label.librry_main"/></a>
        </h1>

        <h2 class="head-subtitle"><spring:message code="label.description_main"/></h2>
    </div>
</header>